package UnOfficeDeTourisme;

/**
 * Interface definition : SGSites
 * 
 * @author OpenORB Compiler
 */
public class _SGSitesStub extends org.omg.CORBA.portable.ObjectImpl
        implements SGSites
{
    static final String[] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/SGSites:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = UnOfficeDeTourisme.SGSitesOperations.class;

    /**
     * Operation ajouterVisite
     */
    public int ajouterVisite(int idSite, UnOfficeDeTourisme.Visite v)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("ajouterVisite",true);
                    _output.write_long(idSite);
                    UnOfficeDeTourisme.VisiteHelper.write(_output,v);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("ajouterVisite",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.ajouterVisite( idSite,  v);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation ajouterSite
     */
    public int ajouterSite(UnOfficeDeTourisme.Site s)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("ajouterSite",true);
                    UnOfficeDeTourisme.SiteHelper.write(_output,s);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("ajouterSite",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.ajouterSite( s);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation ajouterTypeEntree
     */
    public int ajouterTypeEntree(int idVisite, float prix, String nomTE)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("ajouterTypeEntree",true);
                    _output.write_long(idVisite);
                    _output.write_float(prix);
                    _output.write_string(nomTE);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("ajouterTypeEntree",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.ajouterTypeEntree( idVisite,  prix,  nomTE);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getVisites
     */
    public UnOfficeDeTourisme.Visite[] getVisites(int[] listeIdSites)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getVisites",true);
                    UnOfficeDeTourisme.listeLongHelper.write(_output,listeIdSites);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Visite[] _arg_ret = UnOfficeDeTourisme.listeVisitesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getVisites",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.getVisites( listeIdSites);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getAllVisites
     */
    public UnOfficeDeTourisme.Visite[] getAllVisites()
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getAllVisites",true);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Visite[] _arg_ret = UnOfficeDeTourisme.listeVisitesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getAllVisites",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.getAllVisites();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation calculerStatistiques
     */
    public UnOfficeDeTourisme.statistiques calculerStatistiques(UnOfficeDeTourisme.Site[] sites)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("calculerStatistiques",true);
                    UnOfficeDeTourisme.listeSitesHelper.write(_output,sites);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.statistiques _arg_ret = UnOfficeDeTourisme.statistiquesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("calculerStatistiques",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.calculerStatistiques( sites);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getPosProches
     */
    public UnOfficeDeTourisme.Visite[] getPosProches(UnOfficeDeTourisme.GPS geo)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getPosProches",true);
                    UnOfficeDeTourisme.GPSHelper.write(_output,geo);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Visite[] _arg_ret = UnOfficeDeTourisme.listeVisitesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getPosProches",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.getPosProches( geo);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation majSite
     */
    public void majSite(int idSite, UnOfficeDeTourisme.datecut ouverture, UnOfficeDeTourisme.datecut fermeture)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("majSite",true);
                    _output.write_long(idSite);
                    UnOfficeDeTourisme.datecutHelper.write(_output,ouverture);
                    UnOfficeDeTourisme.datecutHelper.write(_output,fermeture);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("majSite",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    _self.majSite( idSite,  ouverture,  fermeture);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getTypeEntrees
     */
    public UnOfficeDeTourisme.TypeEntree[] getTypeEntrees(int[] listeVisites)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getTypeEntrees",true);
                    UnOfficeDeTourisme.listeLongHelper.write(_output,listeVisites);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.TypeEntree[] _arg_ret = UnOfficeDeTourisme.listeTypeEntreesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getTypeEntrees",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.getTypeEntrees( listeVisites);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation listeDesSites
     */
    public UnOfficeDeTourisme.Site[] listeDesSites()
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("listeDesSites",true);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Site[] _arg_ret = UnOfficeDeTourisme.listeSitesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("listeDesSites",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.listeDesSites();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation consulterVisite
     */
    public UnOfficeDeTourisme.Visite consulterVisite(int idVisite)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("consulterVisite",true);
                    _output.write_long(idVisite);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Visite _arg_ret = UnOfficeDeTourisme.VisiteHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("consulterVisite",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGSitesOperations _self = (UnOfficeDeTourisme.SGSitesOperations) _so.servant;
                try
                {
                    return _self.consulterVisite( idVisite);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
